package com.relational.mapping.Service.Impl;

import com.relational.mapping.Model.Admin;
import com.relational.mapping.Repository.AdminRepository;
import com.relational.mapping.Service.AdminService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author Csea
 * @title
 * @date 2019/6/10 15:48
 */
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminRepository repository;

    @Override
    public Admin save(Admin admin) {
        return repository.save(admin);
    }

    @Override
    public Admin findById(Integer adminId) {
        return repository.findById(adminId).orElse(null);
    }

    @Override
    public void deleteId(Integer adminId) {
        repository.deleteById(adminId);
    }
}
